<?php
$title = "Rozmowa";
require_once("includes/head.php"); if (!$_GET['ajax']) require_once("includes/head_start.php"); 
?>
<?php if(substr_count($_SERVER['HTTP_USER_AGENT'], "irefox")==0 || $player -> ajax == 'N') {
echo('<script type="text/javascript" src="js/jquery.js"></script>');
} 
$db -> Execute("UPDATE priv SET unread='Y' WHERE ownerid=".$player -> id);
?>
	<script type="text/javascript" src="js/o.js"></script>
	<script type="text/javascript" src="js/priv.js"></script>
	<div id="priv" style="overflow:auto;width:400px;height:355px;" >

	<?php require_once("priv_view.php"); ?>

	</div>
	<?php     
	if ($_GET['to'] == '') 
	{
		$napisz = $db -> SelectLimit("SELECT ownerid FROM priv WHERE senderid=".$player -> id." ORDER BY id DESC", 1);
		$napiszdo = $napisz -> fields['ownerid'];
		$napisz -> Close();
	} else {
		$napiszdo = $_GET['to'];
	}
	if (!ereg("^[0-9]*$", $_GET['to'])) $napiszdo = '';

	?>
	<div align="center"><form method="post" id="send" action="priv_send.php" >
	<textarea cols="59" rows="3" name="tekst" id="tekst" onkeydown="Sub_form(event, this)" ></textarea><br>
	do ID <input type="text" name="do" size="4" value="<?php echo($napiszdo); ?>"/>
	[<a href="priv.php" >odśwież</a>] <input type="submit" name="send" value="Wyślij" />
	</form></div>


	<br><br><div id="privonline" style="overflow:hidden;width:400px;" >

<?php require_once("priv_online.php"); ?>

</div>

<?php if (!$_GET['ajax']) require_once("includes/foot.php"); ?>
